package com.ap.core.domain;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDateTime;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * User: Rohit.Dixit
 */
@Entity
@Table(name = "T_MESSAGE_TYPE")
@AttributeOverride(name = "id",column = @Column(name = "MESSAGE_TYPE_CODE"))
@TypeDef(name = "id",  typeClass = String.class)
public class MessageType extends Identifiable<String> {

	private static final long serialVersionUID = 8339070221409552886L;

	@Column(name = "MESSAGE_TYPE_NAME")
    private String messageTypeName;

	@Column(name = "MESSAGE_DESCRIPTION")
    private String messageDescription;
	
	@Column(name = "INSERT_TMSTMP")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime insertTimestamp;

    private MessageType(){

    }

    public String getMessageDescription() {
        return messageDescription;
    }

    public String getMessageTypeName() {
        return messageTypeName;
    }

	/**
	 * @return the insertTimestamp
	 */
	public LocalDateTime getInsertTimestamp() {
		return insertTimestamp;
	}

	/**
	 * @param insertTimestamp the insertTimestamp to set
	 */
	public void setInsertTimestamp(LocalDateTime insertTimestamp) {
		this.insertTimestamp = insertTimestamp;
	}
    
}
